草庐IT

windows - System.StackOverflow 错误

全部标签

ruby-on-rails - 如何从 Ruby on Rails 应用程序返回正确的 HTTP 错误代码

我有RoR3.0网络应用程序,它充当OAuthAPI提供程序。现在,在API中,我想向API使用者返回正确的HTTP错误代码。我该怎么做?例子如下:defdestroy_oauth@item=Item.find(params[:id])if(!@item.nil?&&@item.user_id==current_user.id)@item.destroyrespond_todo|format|format.jsformat.xmlendelseraiseActionController::RoutingError.new('Forbidden')endend因此,如果出现错误,我会尝试

ruby - bundler 和错误的 binstubs?

我运行railss或bundleexecrailss并收到此警告:Bundlerisusingabinstubthatwascreatedforadifferentgem.Thisisdeprecated,infutureversionsyoumayneedto`bundlebinstubrails`toworkaroundasystem/bundleconflict.这是什么意思?通过查看bundler站点,我对binstubs的理解是您可以为它们设置可执行文件,因此您可以执行bin/blabla而不是运行bundleexecblabla。所以这个错误是说我的bundler没有设置到

ruby-on-rails - 如何在 Windows 中更新 ruby

我通过rails安装程序下载了ruby​​,但我现在想要ruby​​2.0.0并且已经下载了它。我该如何更新我的ruby,因为我这样做了ruby-v它仍然作为ruby​​版本1.9.3出现。 最佳答案 我建议使用Chocolatey来管理您的ruby​​安装。这是一个unix风格的windows包管理器。安装非常简单,您可以在theirwebsite上找到说明。.在cmd.exe(以管理员身份运行)中:@powershell-NoProfile-ExecutionPolicyBypass-Command"iex((new-objec

ruby-on-rails - 路由错误 - 未初始化的常量

我无法在Rails3.2.12中解决这个问题,也许我遗漏了什么。config/routes.rbget"home/index"root:to=>"home#index"devise_for:users,:only=>:omniauth_callbacksmatch'users/auth/:provider/callback'=>'authentications#create'match'/auth/:provider/signout'=>'authentications#signout'app/controllers/authentication_controller.rbclassA

ruby-on-rails - 错误 : failed to build gem native extension when installing rails on mac mountian lion os

我最近更新到MountainLion并重新安装了Ruby,但是当我尝试运行测试Rails应用程序时,我收到一条错误消息,指出“我的系统当前未安装Rails”。我按照它说的做,输入sudogeminstallrails并得到:clearedfaster_requirecachesduetonewgeminstall...Successfullyinstalledrails-3.2.71geminstalledInstallingridocumentationforrails-3.2.7...InstallingRDocdocumentationforrails-3.2.7...但是当我检

ruby-on-rails - Ruby:在 Windows 7 下安装 EventMachine 时出现问题

我正在尝试通过捆绑在Windows7上安装gemEventMachine(使用Ruby1.9.2和RubyInstaller),但出现以下错误。我还安装了DevKit,它可以正常工作,但我仍然无法弄清楚问题是什么:Installingeventmachine(0.12.10)withnativeextensionsC:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in`rescueinblockinbuild_extensions':ERROR:Failedtobuildgemnativeextension.(G

ruby - 将 Ruby 程序作为 Windows 服务运行?

是否可以将ruby​​应用程序作为Windows服务运行?我看到有一个相关问题讨论运行JavaApplicationasaWindowsService,如何使用Ruby应用程序执行此操作? 最佳答案 查看以下库:Win32Utils.您可以创建一个简单的服务,您可以在闲暇时启动/停止/重新启动。我目前正在使用它来管理Windows托管的Rails应用程序的Mongrel实例,并且它可以完美运行。 关于ruby-将Ruby程序作为Windows服务运行?,我们在StackOverflow上

ruby-on-rails - 为什么我会收到 bcrypt-ruby gem 安装错误?

尝试安装gemdevise时出错,安装停止于gembcrypt-ruby:$geminstallbcrypt-rubyErrorinstallingbcrypt-ruby:ERROR:Failedtobuildgemnativeextension.我在RVM下使用Ruby运行OSX10.6.7。我重新安装了最新版本的xcode并重新安装了Ruby64位、Rails和所有的gem。 最佳答案 我在OSX10.7.3下安装时遇到了同样的问题。安装gem时,我的错误消息是:Buildingnativeextensions.Thiscoul

ruby-on-rails - 在 Windows 上安装特定的 Ruby on Rails 版本

通常我使用:geminstallrails我可以在Windows上安装Rails,但默认情况下,我猜安装的是最新版本3.0.3。如果我想安装其他版本的Rails,比如3.0.1,我该怎么做? 最佳答案 例子:geminstallrails-v3.0.1另外,运行gem-h可以看到gem的所有选项注意事项:如果你在*nix上使用RVM强烈推荐用于Ruby管理。 关于ruby-on-rails-在Windows上安装特定的RubyonRails版本,我们在StackOverflow上找到一个

ruby - 错误 : Gem bundler is not installed, 首先运行 `gem install bundler`

您好,我一直在尝试安装Rubygem包。收到此消息后,我按照geminstallbundle的说明进行操作,但是当我键入bundle-v时它仍然不起作用。我也打字捆绑并接收/Users/edmundmai/.rvm/bin/bundle所以它存在!!那么为什么它不起作用!我没有得到的神秘$PATH有什么问题吗?(我是菜鸟)。这是我的.bash_profile:PATH=$PATH:~/binexportPATH[[-s"$HOME/.rvm/scripts/rvm"]]&&source"$HOME/.rvm/scripts/rvm"#LoadRVMintoashellsession*a